{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# GL颜色空间 RGBA"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "heading_collapsed": true
   },
   "source": [
    "# glcolorscale\n",
    "\n",
    "官方文档里提供的demo 无法使用  \n",
    "```\n",
    "gst-launch-1.0 -v videotestsrc ! video/x-raw ! glcolorscale ! ximagesink\n",
    "\n",
    "警告: 错误管道: 无法将 glcolorscale0 链接到 ximagesink0\n",
    "```\n",
    "\n",
    "**解决办法**: 要想在原始的 pipelines 使用 glcolorscale ,你可以用以下组件连接使用 `glupload/gldownload/glcolorconvert` 或者替换为 `glfilterbin`\n",
    "\n",
    "例如：\n",
    "\n",
    "- gst-launch-1.0 videotestsrc ! glfilterbin filter=glcolorscale ! ximagesink\n",
    "\n",
    "等价于：\n",
    "\n",
    "- gst-launch-1.0 videotestsrc ! glupload ! glcolorconvert ! glcolorscale ! glcolorconvert ! gldownload ! ximagesink\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# glvideomixer\n",
    "\n",
    "- \n",
    "\n",
    "```sh\n",
    "gst-launch-1.0  glvideomixer name=m ! glimagesink \\\n",
    "     videotestsrc ! video/x-raw, format=YUY2 ! glupload ! glcolorconvert ! m. \\\n",
    "     videotestsrc pattern=12 ! video/x-raw, format=I420, framerate=5/1, width=100, height=200 ! queue ! \\\n",
    "     glupload ! glcolorconvert ! m. \\\n",
    "     videotestsrc ! glupload ! gleffects effect=2 ! queue ! m.  \\\n",
    "     videotestsrc ! glupload ! glfiltercube ! queue ! m. \\\n",
    "     videotestsrc ! glupload ! gleffects effect=6 ! queue ! m.\n",
    "```     \n",
    "\n",
    "-      \n",
    "```sh\n",
    "gst-launch-1.0  glvideomixer name=m ! glimagesink \\\n",
    "rtspsrc name=src location=rtsp://admin:admin@10.86.77.12:554/h264/ch1/sub/av_stream latency=10 ! decodebin ! queue ! glupload ! glcolorconvert ! glcolorscale ! m.\n",
    "```  \n",
    "\n",
    "- \n",
    "```sh\n",
    "gst-launch-1.0  glvideomixer name=m ! glimagesink \\\n",
    "     rtspsrc name=src location=rtsp://admin:admin@10.86.77.12:554/h264/ch1/sub/av_stream latency=10 ! decodebin ! queue ! glupload !  gleffects effect=6 ! queue ! m.\n",
    "```  \n",
    "\n",
    "- \n",
    "```sh\n",
    "gst-launch-1.0  glvideomixer name=m ! glimagesink \\\n",
    "rtspsrc name=src location=rtsp://admin:admin@10.86.77.12:554/h264/ch1/sub/av_stream latency=10 ! decodebin ! queue ! glupload ! glcolorconvert ! glfiltercube ! queue ! m.\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
